using System;
using System.ComponentModel.DataAnnotations.Schema;
using UwinEducation.Shared.Enums;

namespace UwinEducation.Domain.Entities
{
    /// <summary>
    /// 描述管理实体
    /// </summary>
    [Table("basic_descriptions")]
    public class Description : EntityBase
    {
        /// <summary>
        /// 描述ID
        /// </summary>
        public Guid Id { get; private set; }

        /// <summary>
        /// 描述标题
        /// </summary>
        public string Title { get; set; }
        /// <summary>
        /// 描述内容
        /// </summary>
        public string Content { get; set; }
        /// <summary>
        /// 描述内容(英文)
        /// </summary>
        public string EnContent { get; set; }
        /// <summary>
        /// 描述类型
        /// </summary>
        public DescriptionType Type { get; set; }


        protected Description() { }

        /// <summary>
        /// 创建描述
        /// </summary>
        public static Description Create(
            string title,
            string? content,
            string? enContent,
            DescriptionType type
        )
        {
            return new Description
            {
                Id = Guid.NewGuid(),
                Title = title,
                Content = content ?? string.Empty,
                EnContent = enContent ?? string.Empty,
                Type = type,
                CreatedAt = DateTime.Now
            };
        }
    }
} 